Skip to content

chore: update platform packages to 0.15.0 and Better Auth to 1.7.22 - #218

Merged
s3rot0n1n merged 1 commit into
mainfrom
chore/codelit-platform-0.14
Nov 22, 2026
Merged

s3rot0n1n merged 1 commit into
mainfrom
chore/codelit-platform-0.14

Conversation

@s3rot0n1n

Copy link
Copy Markdown
Contributor

Supersedes #188, which bumps only the platform group and not Better Auth, so it can't meet oauth-server-kit's new peer floor. This follows MediaLit's codelitdev/medialit#287.

Versions

  • @codelitdev/*: billing, mcp-server-kit, oauth-server-kit, observability, platform and platform-conformance (API), and design-system (web and docs), go from 0.8.0 to 0.15.0.
  • Better Auth: better-auth, @better-auth/oauth-provider, @better-auth/cimd and the @better-auth/core override go from 1.7.7 to 1.7.22. That's the version the kit tests against, and it carries fixes for GHSA-fvxx-76fc-893x, GHSA-2f9c-7xj7-gh55 and GHSA-9hm7-xhfp-cx58.
  • Overrides: new root overrides pin @better-auth/utils 0.5.1, better-call 1.4.5 and @better-fetch/fetch 1.3.3. In bun.lock, every one of these packages resolves to a single version.

Hardened auth options (kit 0.10)

  • Session cookie: advanced comes from secureCookieOptions, wrapped in auth/cookie-options.ts.
    • With AUTH_COOKIE_DOMAIN set, it stays __Secure-frontlit.session_token, shared with the dashboard.
    • On a single https host it becomes __Host-frontlit.session_token.
    • Over http it stays frontlit.session_token.
    • FrontLit has no production deployment, so the rename on single-host https needs no migration.
    • session-freshness.ts parses the session cookie by name and now also accepts __Host-. The web app forwards the whole cookie header to the API, so it needed no change.
  • Session cache: session spreads secureSessionOptions(), which turns off the cookie cache, so a revoked session stops working immediately. The existing model name, expiry and update age are kept.
  • Passwords: emailAndPassword: secureEmailAndPasswordOptions() keeps password sign-in off. Before, it was off by Better Auth's default.
  • Client IP: Better Auth reads the client address only from x-frontlit-client-ip. createClientIpMiddleware runs before Better Auth's handler and overwrites that header from req.ip, so a client can't spoof it through X-Forwarded-For.
  • Trust proxy: a new TRUST_PROXY setting (a hop count, true, false, or addresses and subnets) sets Express's trust proxy. When it's unset, ENABLE_TRUST_PROXY=true still trusts one hop and nothing is trusted otherwise, as before. It's documented in both .env.example files and in the self-hosting docs, and passed through docker-compose.yml.
  • Test fixtures: kit 0.10 made authenticatedAt required on session identities, so the test fixtures now set it.

MCP openWorldHint

openWorldHint now comes from one OPEN_WORLD_MCP_TOOLS set in mcp/policy.ts, next to HIGH_IMPACT_MCP_TOOLS. The registry advertises true for tools in the set and false for every other tool, and the per-tool annotations type no longer accepts openWorldHint.

I traced every mail-sending function (sendMail, SendLit sendEmail, sendBroadcast and testEspConfig) up to the operations that call it. These tools reach outside the team's workspace:

  • Email to real people:
    • send_broadcast;
    • test_esp_config;
    • reply_to_ticket, which emails the requester a fresh magic link;
    • create_ticket, which emails the requester a receipt and can start an Inbox AI auto-reply. It was false before.
  • Live GitHub calls: the 16 GitHub tools that were already true: setup, repository listing and validation, connect, sync, pause, resume, disconnect, capabilities, proposal submission, and the git migration tools.

These change from true to false:

  • Contacts, segments and broadcast drafts: create, update, delete, list and stats.
  • Email and ESP settings: get, update and remove.

They only read or write the team's own data in its provisioned SendLit team. FrontLit creates only broadcast sequences there, so adding a contact or tag can't start an automation that emails anyone. If FrontLit ever exposes drip sequences or rules, create_contact and add_contact_tag belong in the set; the code comment says so.

Team invitations email people too, but they're REST-only and not exposed over MCP. mcp/open-world.test.ts registers every real tool and checks examples on both sides. It also checks that every tool advertises a boolean and that the set names only real tools.

Changelogs checked (0.8.0 to 0.15.0)

  • oauth-server-kit:
    • 0.10's hardened options are adopted above.
    • 0.14.1's login-page fixes come with the package: the email button waits for Turnstile, and the page fits phones.
    • The resource client was already built from the real Better Auth instance.
  • billing 0.11–0.13 (planFeatures, planLimits, paid statuses ending at paidThroughAt plus 7 days, env-selected provider): not applicable. FrontLit uses billing only to generate its schema, and doesn't call createBilling. check:drift passes.
  • platform 0.9 and 0.11: recentAuthActions and the shared custom-domain verification are optional, and not adopted here. FrontLit's domains/queries.ts could move to createDomainVerification in a follow-up.
  • mcp-server-kit: no changes after 0.8.0. FrontLit registers tools through its own registry, which handles the open-world hint above.
  • design-system 0.14 and 0.15: the registry already installs into components/ui/codelit/, and components.json has no registry configured. The 0.15 DialogHeader spacing is a registry source change, so it only applies after reinstalling that component.
  • observability: batching landed before 0.8. The 0.15 additions (groups, personProperties, processPerson, and the PostHog ingestion fixes) need no code change.

Tests

  • Repo checks: format:check, typecheck and check:drift pass. lint has 0 errors; its 10 warnings are in apps/web files this PR doesn't touch.
  • bun run test:
    • on 0.14.1: all suites passed (API 803 passed, 1 skipped);
    • on 0.15.0: 802 passed, with 1 failure in documentation/github/source.test.ts ("discards Git edits…"). That file passes 3 of 3 runs alone, so it's load-sensitive under the full parallel run and unrelated to this change.
    • Web, sites, text-editor and page-builder pass.
  • Builds: the web, docs and API builds succeed.
  • Browser (Chrome at 375 px, local stack with Postgres, SendLit and Mailpit in a separate compose project, Cloudflare's always-pass Turnstile test keys), on both 0.14.1 and 0.15.0:
    • the hosted login page fits with no sideways scroll, and inputs use 16 px text;
    • the email button stays disabled until the Turnstile token arrives, then enables;
    • the code went through the captcha-checked send to Mailpit, sign-in succeeded and landed in the app;
    • the session row recorded the IP from the new header (::1, stored as a /64 prefix);
    • I created a team, which provisioned SendLit;
    • Inbox, Broadcasts, Contacts, Articles, Pages, Members, Media and Account loaded with no errors and no sideways scroll.

Not tested / found along the way

  • Single-host https cookie: I didn't test the __Host- cookie on a real https deployment, or the cross-subdomain __Secure- cookie. Unit tests pin all three cookie names.
  • MCP over a real client: not exercised. The annotations are covered by the unit test.
  • Pre-existing: local compose can't migrate. docker-compose.local.yml still mounts docker/frontlit-migrate.sh and docker/postgres-init/, which 3a5e665 removed. On a fresh checkout, Docker creates empty directories in their place and the frontlit-migrate job applies nothing. I ran apps/api/src/db/migrate.ts from the host instead. Worth a separate fix.
  • Pre-existing: inbox search text size. The dashboard's inbox search box uses 14 px text (text-sm), so iOS zooms in on focus. Not changed here.

Release

Nothing is deployed. FrontLit has no production deployment; any deploy follows the usual release flow and is yours to run.

🤖 Generated with Claude Code

Every @codelitdev package moves from 0.8.0 to 0.15.0. better-auth,
@better-auth/oauth-provider, @better-auth/cimd and @better-auth/core
move to 1.7.22, with @better-auth/utils 0.5.1, better-call 1.4.5 and
@better-fetch/fetch 1.3.3 pinned so one copy of each resolves.

Adopt the kit's hardened Better Auth options: secureCookieOptions with a
client-IP header, secureSessionOptions (no cookie cache) and
secureEmailAndPasswordOptions (passwords stay off). Express trust proxy
comes from a new TRUST_PROXY setting, and ENABLE_TRUST_PROXY keeps working
when it is unset. createClientIpMiddleware runs before Better Auth.

MCP openWorldHint now comes from one OPEN_WORLD_MCP_TOOLS set: tools
that email people (send_broadcast, test_esp_config, reply_to_ticket,
create_ticket) or call GitHub live. Every other tool advertises false.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 22, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-22T14:05:50.608749Z 43e3a66 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@s3rot0n1n
s3rot0n1n merged commit 256658c into main Nov 22, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant